package dubbot

import (
	"github.com/hyperway/pkg/component"
	"net/http"
)

func decoder(result interface{}) (*component.ServerResponse, error) {
	attrs := make(map[string]interface{}, 8)
	// 从Attachment中读取StatusCode，HeaderMap
	status := 200
	header := make(http.Header)

	return &component.ServerResponse{
		StatusCode: status, Headers: header, Attachments: attrs, Data: result,
	}, nil
}
